package com.ty.controller;

import com.ty.bean.Loanquote;
import com.ty.common.bean.ResultBean;
import com.ty.common.controller.BaseController;
import com.ty.query.LoanquoteQuiry;
import com.ty.service.LoanquoteSevice;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Collections;
import java.util.List;
import java.util.Map;

@Api("报价记录")
@RestController
@RequestMapping
public class LoanquoteController extends BaseController {

    @Autowired
    LoanquoteSevice loanquoteSevice;

    @ApiModelProperty("查询")
    @PostMapping("/loanquote")
    public ResultBean query(@RequestBody Loanquote loanquote){
        List rs = (List) loanquoteSevice.query(loanquote);
        return success("查询",rs);
    }

    @ApiModelProperty("条件查询")
    @PostMapping("/loanquote")
    public ResultBean queryByMap(@RequestBody LoanquoteQuiry loanquoteQuiry){
        List list = Collections.singletonList(loanquoteSevice.queryByMap((Map) loanquoteQuiry));
        return success("订单列表",list);
    }
}
